package project2;
public class HalfSpace extends PhysicsObject {
	
	public static final String RIGHT_BOUNDARY = "right";
	public static final String LEFT_BOUNDARY = "left";
	public static final String TOP_BOUNDARY = "top";
	public static final String BOTTOM_BOUNDARY = "bottom";
	Vector2f normal;
	// Right-hand side of the plane equation: Ax + By = C
	float intercept;
	public String side;
	
	public HalfSpace(Vector2f point, Vector2f normal, String side) {
		//inverseMass = 0;
		mass = Float.POSITIVE_INFINITY;
		this.normal = new Vector2f(normal);
		this.normal.normalize();
		intercept = point.dot(this.normal);
		this.side = side;
	}
	
	public boolean isRighttBoundary(){
		return side.equalsIgnoreCase(RIGHT_BOUNDARY);
	}
	
	public boolean isLeftBoundary(){
		return side.equalsIgnoreCase(LEFT_BOUNDARY);
	}
	public boolean isTopBoundary(){
		return side.equalsIgnoreCase(TOP_BOUNDARY);
	}
	public boolean isBottomBoundary(){
		return side.equalsIgnoreCase(BOTTOM_BOUNDARY);
	}
}